package com.bhs.sansonglogistics.ui.adapter;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.bhs.sansonglogistics.R;
import com.bhs.sansonglogistics.bean.OperatingRecordBean;
import com.bhs.sansonglogistics.utils.DateUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

public class OperatingRecordAdapter extends BaseQuickAdapter<OperatingRecordBean, BaseViewHolder> {
    public OperatingRecordAdapter() {
        super(R.layout.item_operating_record);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, OperatingRecordBean item) {
        helper.setText(R.id.tv_operating_personnel,item.getLog_remark());
        helper.setText(R.id.tv_time, DateUtils.getTime(item.getCreate_time()));
        helper.setBackgroundRes(R.id.view,helper.getLayoutPosition()==0?R.drawable.bg_oval_blue:R.drawable.bg_oval_grey);
        helper.setVisible(R.id.view3,helper.getLayoutPosition()!= mData.size()-1);
    }
}
